import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Flow from '@/components/Flow'
import bpmn1111 from '@/components/bpmn1111'
import FlowChart from '@/components/FlowChart'
import FlowChartG6 from '@/components/flowChartG6'

/**
 * 后台配置路由思路
 * 刚开始时只有首页、404、500这几个常规页面
 * 通过异步获取路由之后，再通过数组拼接返回
 */
Vue.use(Router)
const _import_ = file => require('@/views/' + file + '.vue').default // vue-loader at least v13.0.0+
const constantRouters = [
    {
        path: '/',
        name: 'HelloWorld',
        component: HelloWorld,
        hidden: true
    },
    {
        path: '/flow',
        name: 'Flow',
        component: Flow,
        hidden: true
    },
    {
        path: '/bpmn',
        name: 'bpmn',
        component: bpmn1111,
        hidden: true
    },
    {
        path: '/flowChart',
        name: 'FlowChart',
        component: FlowChart,
        hidden: true
    },
    {
        path: '/flowChartG6',
        name: 'FlowChartG6',
        component: FlowChartG6,
        hidden: true
    },
    {
        path: '/404',
        name: '404',
        component: _import_('404'),
        hidden: true
    },
    {
        path: '/500',
        name: '500',
        component: _import_('500'),
        hidden: true
    },
]
const routers = new Router({
    mode: 'hash',
    routes: constantRouters,
    linkActiveClass: "router-link-active",
})
export default routers
